(() => {
	let ele = {}

	// BUG反馈
	ele.feedback = $('#feedback')
	ele.modal_feedback = $('#modal-feedback')
	ele.confirm_feedback = $('#confirm-feedback')
	// 打开BUG反馈弹框
	ele.feedback.onclick = () => {
		ele.modal_feedback.style.display = 'block'
	}
	// 关闭BUG反馈弹框
	ele.confirm_feedback.onclick = () => {
		ele.modal_feedback.style.display = 'none'
	}

	// 清理缓存按钮
	document.addEventListener('plusready', () => {
		let clear = $('#clear-cache');
		let userid = getCookie('userid');
		let ua = navigator.userAgent;
		if (ua.indexOf('Html5Plus')) {
			clear.style.display = 'flex';
			clear.onclick = () => {
				openTips('清理中请稍后...', 1000);
				plus.cache.clear(res => {
					setTimeout(() => {
						openTips('清理完成');
					}, 1000);
				})
			}
		}
	});

	// 退出登录
	ele.modal_logout = $('#modal-logout')
	ele.openlogout = $('#openlogout')
	ele.logCancell = $('#logCancell')
	// 打开退出登录弹框
	ele.openlogout.onclick = () => {
		ele.modal_logout.style.display = 'block'
	}
	ele.logCancell.onclick = () => {
		ele.modal_logout.style.display = 'none'
	}

	$('#logDeter').onclick = () => {
		clearAllCookie();
		location.replace(LOGIN_PAGE);
	}

})();